package com.project.bean;

import com.project.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class Manger {
    @Autowired//自动注入，扫描已注册得spring组件，注入匹配该属性的组件
    @Qualifier("Us")//按名称注入该接口的组件
    private IUserService service;
    public void add(){
        service.speak();
    }
}
